<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:include="http://www.w3.org/1999/xhtml">
<head>
    <th:block th:include="include :: header('新增牛奶出库')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-ncOutputChicken-add" >
        <input id="ncorderCfId" name="ncorderCfId" th:value="${cforderId}" type="hidden">

        <div class="form-group">
            <label class="col-sm-3 control-label">库存：</label>
            <div class="col-sm-8">
                <select id="inputId" name="inputId" class="form-control select2-multiple" required>
                    <option th:each="stock:${stocks}" th:value="${stock.inputId}" th:text="${stock.inputCode} +'牛奶' +'-('+${stock.leftAmout}+')kg'"
                    ></option>
                </select>
            </div>
        </div>
       <!-- <div class="form-group">
            <div class="col-sm-8">
                <input id="milkCode" name="milkCode" class="form-control" type="hidden" >
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-8">
                <input id="cropNameCn" name="cropNameCn" class="form-control" type="hidden" >
            </div>
        </div>-->

        <div class="form-group">
            <label class="col-sm-3 control-label">供应数量（kg）：</label>
            <div class="col-sm-8">
                <input id="outputAmout" name="outputAmout" class="form-control" type="number" required>
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-3 control-label">出库时间：</label>
            <div class="col-sm-8">
                <input id="outputTime" data-format="yyyy-MM-dd HH:mm:ss"  name="outputTime" placeholder="请选择时间"  th:value="*{#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd HH:mm:ss')}" class="form-control" type="text" th:class="time-input" >

            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-3 control-label">出库经手人：</label>
            <div class="col-sm-8">
                <input id="outputUser" name="outputUser" class="form-control" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea id="remark" name="remark"  class="form-control valid" type="text" rows="4" ></textarea>
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    var prefix = ctx + "system/ncOutputMilk"
    $("#form-ncOutputChicken-add").validate({
        rules:{
            xxxx:{
                required:true,
            },
        },
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/addWork", $('#form-ncOutputChicken-add').serialize(),
            function (data){
                if (data.code == 0) {
                    parent.$('#bootstrap-table-1').bootstrapTable('refresh', {
                        silent: true
                    });
                    parent.$('#bootstrap-table').bootstrapTable('refresh', {
                        silent: true
                    });
                }
                // $.parent.table.refresh()
            }

            );


        }
    }
    //刷新页面
    function reload() {
        window.location.reload()
    }
</script>
</body>
</html>
